package com.bjzsly.star3.xyh.base;

import android.app.Application;

import com.bjzsly.star3.xyh.auth.TxShareUtils;
//import com.bjzsly.star3.xyh.colorUi.util.SharedPreferencesMgr;
//import com.bjzsly.star3.xyh.manager.LoginManager;
//import com.bjzsly.star3.xyh.model.User;
//import com.bjzsly.star3.xyh.model.UserInfo;
//import com.bjzsly.star3.xyh.utils.VoiceUtils;
import com.tencent.smtt.sdk.QbSdk;

import java.util.HashSet;
import java.util.Set;

import io.dcloud.application.DCloudApplication;

//import cn.jpush.android.api.JPushInterface;
//import cn.jpush.android.api.TagAliasCallback;


public class BaseApplication extends DCloudApplication {


//    private User mUser;

    private static BaseApplication instance;

//    private static UserInfo mUserInfo =null;
//    private String tags[] = new String[]{"debug"};
//    private Set<String> set = new HashSet<>();


    @Override
    public void onCreate() {
        super.onCreate();
//        QbSdk.initX5Environment(this, null);
        instance = this;
//        SharedPreferencesMgr.init(this, "sow");
        TxShareUtils.initShare(this);
//        VoiceUtils.init(this);
//        JPushInterface.setDebugMode(true);
//        JPushInterface.init(this);
        //JPushInterface.setAlias(this, BuildConfig.BUILD_TYPE, null);
        //极光推送设置tag，按标签分发消息，标签间互不干扰
        //debug 测试环境  release 线上环境
//        final Set<String> sets = new HashSet<String>();
        //sets.add("debug");
//        sets.add("release");
//
//        String registrationID = JPushInterface.getRegistrationID(this);
//
//        JPushInterface.setTags(this, sets, new TagAliasCallback() {
//            @Override
//            public void gotResult(int i, String s, Set<String> set) {
//                //JPushInterface.checkTagBindState(getApplicationContext(),i,s);
//            }
//        });
//
//        LoginManager.getInstance().checkLoginData();
    }


//    public User getUser() {
//        return mUser;
//    }
//
//    public void setUser(User mUser) {
//        this.mUser = mUser;
//    }

    public static BaseApplication getInstance() {
        return instance;
    }

}
